KEYCLOAK_SCOPES = [
    {
        "id": "e273eb7c-6ed1-427a-b292-d70d0fe6d6a1",
        "name": "commission_voter",
        "description": "Can vote to the security commission",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "display.on.consent.screen": "false",
            "gui.order": "",
            "consent.screen.text": "",
        },
    },
    {
        "id": "1dc4ab12-3048-43eb-88f0-8cd46aa39b05",
        "name": "role_list",
        "description": "SAML role list",
        "protocol": "saml",
        "attributes": {
            "consent.screen.text": "${samlRoleListScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "92a513e8-011b-41d5-8a2a-8676b6dd21fc",
                "name": "role list",
                "protocol": "saml",
                "protocolMapper": "saml-role-list-mapper",
                "consentRequired": False,
                "config": {
                    "single": "false",
                    "attribute.nameformat": "Basic",
                    "attribute.name": "Role",
                },
            }
        ],
    },
    {
        "id": "c51245de-fac8-4b86-89f4-452466ae4987",
        "name": "saml_organization",
        "description": "Organization Membership",
        "protocol": "saml",
        "attributes": {"display.on.consent.screen": "false"},
        "protocolMappers": [
            {
                "id": "9f9d3a5c-12e9-4e6a-b55f-ca71f9a2bde2",
                "name": "organization",
                "protocol": "saml",
                "protocolMapper": "saml-organization-membership-mapper",
                "consentRequired": False,
                "config": {},
            }
        ],
    },
    {
        "id": "2d557704-531d-479b-9720-c548985742a0",
        "name": "phone",
        "description": "OpenID Connect built-in scope: phone",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "consent.screen.text": "${phoneScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "6c993394-57a3-4821-b853-d34ea69510bf",
                "name": "phone number",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "phoneNumber",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "phone_number",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "e79ccab5-08d2-4a9b-96ac-db58fe365590",
                "name": "phone number verified",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "phoneNumberVerified",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "phone_number_verified",
                    "jsonType.label": "boolean",
                },
            },
        ],
    },
    {
        "id": "17f2be1d-e95a-4f55-b56e-c60576f5cbf6",
        "name": "shutdown-control",
        "description": "No more power.",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "display.on.consent.screen": "false",
            "gui.order": "",
            "consent.screen.text": "",
        },
        "protocolMappers": [
            {
                "id": "1bd90f05-9525-4a5b-8554-4a57cf802a90",
                "name": "address",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-address-mapper",
                "consentRequired": False,
                "config": {
                    "user.attribute.formatted": "formatted",
                    "user.attribute.country": "country",
                    "introspection.token.claim": "true",
                    "user.attribute.postal_code": "postal_code",
                    "userinfo.token.claim": "true",
                    "user.attribute.street": "street",
                    "id.token.claim": "true",
                    "user.attribute.region": "region",
                    "access.token.claim": "true",
                    "user.attribute.locality": "locality",
                },
            }
        ],
    },
    {
        "id": "b3e8d836-8a10-4e42-bb8d-991bf18e7130",
        "name": "profile",
        "description": "OpenID Connect built-in scope: profile",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "consent.screen.text": "${profileScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "42266914-26b4-4c0d-ac46-641a4fc657ff",
                "name": "updated at",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "updatedAt",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "updated_at",
                    "jsonType.label": "long",
                },
            },
            {
                "id": "e7ef4a6b-1cfb-4122-a5fc-7aedd30b1b85",
                "name": "birthdate",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "birthdate",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "birthdate",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "a6e4f172-20ea-4e30-9f33-c6c7b66383db",
                "name": "locale",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "locale",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "locale",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "b05966cc-6a8a-4ac9-8b5f-5844cbdafb0b",
                "name": "nickname",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "nickname",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "nickname",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "2323f858-6379-4b2a-a4b1-68f8032cced0",
                "name": "gender",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "gender",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "gender",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "1fde2000-210b-4517-a3f4-6cff387cad0c",
                "name": "picture",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "picture",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "picture",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "0dd0452a-3d8c-4f83-9d8c-1c82662151e6",
                "name": "website",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "website",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "website",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "91d9201c-c6a7-4222-93bd-507a29d60b3d",
                "name": "username",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "username",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "preferred_username",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "46deacc4-011c-4dc8-9cfa-a2db69395c01",
                "name": "full name",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-full-name-mapper",
                "consentRequired": False,
                "config": {
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "userinfo.token.claim": "true",
                },
            },
            {
                "id": "0152070d-5db1-430c-8696-c0445b542065",
                "name": "zoneinfo",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "zoneinfo",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "zoneinfo",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "b63bc8c5-7c04-44fe-b0cf-53d509acffaa",
                "name": "family name",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "lastName",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "family_name",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "efe8713d-f3fa-41c4-bcc1-65ea5ef2fc4b",
                "name": "given name",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "firstName",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "given_name",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "533e617f-a80a-4148-967b-3ca6d7eb9e3a",
                "name": "middle name",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "middleName",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "middle_name",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "38263ea1-7481-4f41-959f-277aa287f6d9",
                "name": "profile",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "profile",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "profile",
                    "jsonType.label": "String",
                },
            },
        ],
    },
    {
        "id": "c066c2ec-b4f9-4416-a8ca-e0f11df3c84c",
        "name": "organization",
        "description": "Additional claims about the organization a subject belongs to",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "consent.screen.text": "${organizationScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "0cd6c648-7461-4e15-93fa-4cbcb9646043",
                "name": "organization",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-organization-membership-mapper",
                "consentRequired": False,
                "config": {
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "organization",
                    "jsonType.label": "String",
                    "multivalued": "true",
                },
            }
        ],
    },
    {
        "id": "b6853ac9-a428-4cdc-a61e-0147c8f37fc5",
        "name": "offline_access",
        "description": "OpenID Connect built-in scope: offline_access",
        "protocol": "openid-connect",
        "attributes": {
            "consent.screen.text": "${offlineAccessScopeConsentText}",
            "display.on.consent.screen": "true",
        },
    },
    {
        "id": "2e97d81f-2df1-47e0-8d6d-c0adfd3948f4",
        "name": "email",
        "description": "OpenID Connect built-in scope: email",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "consent.screen.text": "${emailScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "7416900b-aa3c-420a-8862-e896b2a82094",
                "name": "email",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "email",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "email",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "d72abc0d-0e63-4347-9022-29c32d90a896",
                "name": "email verified",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-property-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "emailVerified",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "email_verified",
                    "jsonType.label": "boolean",
                },
            },
        ],
    },
    {
        "id": "f312d0c8-a00c-4651-b1de-11c568df7422",
        "name": "basic",
        "description": "OpenID Connect scope for add all basic claims to the token",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "false",
            "display.on.consent.screen": "false",
        },
        "protocolMappers": [
            {
                "id": "75689423-3e55-4d30-8575-b683f103db22",
                "name": "auth_time",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usersessionmodel-note-mapper",
                "consentRequired": False,
                "config": {
                    "user.session.note": "AUTH_TIME",
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "auth_time",
                    "jsonType.label": "long",
                },
            },
            {
                "id": "e12f7ca6-c587-484f-b4f7-96247824618b",
                "name": "sub",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-sub-mapper",
                "consentRequired": False,
                "config": {
                    "access.token.claim": "true",
                    "introspection.token.claim": "true",
                },
            },
        ],
    },
    {
        "id": "cedca2b9-9637-4477-8546-e7e65547c0f4",
        "name": "service_account",
        "description": "Specific scope for a client enabled for service accounts",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "false",
            "display.on.consent.screen": "false",
        },
        "protocolMappers": [
            {
                "id": "54dfb849-5227-44ce-b10e-7e9bd40915d4",
                "name": "Client IP Address",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usersessionmodel-note-mapper",
                "consentRequired": False,
                "config": {
                    "user.session.note": "clientAddress",
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "clientAddress",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "bc4673b6-344e-41bd-9e53-c0d520686e08",
                "name": "Client ID",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usersessionmodel-note-mapper",
                "consentRequired": False,
                "config": {
                    "user.session.note": "client_id",
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "client_id",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "51ed03fc-0abf-4222-8c8c-f4f6ae3babab",
                "name": "Client Host",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usersessionmodel-note-mapper",
                "consentRequired": False,
                "config": {
                    "user.session.note": "clientHost",
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "clientHost",
                    "jsonType.label": "String",
                },
            },
        ],
    },
    {
        "id": "0908dc73-29f1-4374-851e-fce191204d72",
        "name": "acr",
        "description": "OpenID Connect scope for add acr (authentication context class reference) to the token",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "false",
            "display.on.consent.screen": "false",
        },
        "protocolMappers": [
            {
                "id": "6ed91738-22f1-4eac-a78d-3d315e137788",
                "name": "acr loa level",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-acr-mapper",
                "consentRequired": False,
                "config": {
                    "id.token.claim": "true",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                },
            }
        ],
    },
    {
        "id": "b49bbd00-3ea0-4177-bf5e-eb33a1b11b51",
        "name": "web-origins",
        "description": "OpenID Connect scope for add allowed web origins to the access token",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "false",
            "consent.screen.text": "",
            "display.on.consent.screen": "false",
        },
        "protocolMappers": [
            {
                "id": "5253781f-cb4c-48f7-8e17-c1d04a404089",
                "name": "allowed web origins",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-allowed-origins-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                },
            }
        ],
    },
    {
        "id": "3729a739-d111-435f-8425-24596d4beae5",
        "name": "address",
        "description": "OpenID Connect built-in scope: address",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "consent.screen.text": "${addressScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "a8524ce1-7b63-4ff3-aad4-1dd01c66169d",
                "name": "address",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-address-mapper",
                "consentRequired": False,
                "config": {
                    "user.attribute.formatted": "formatted",
                    "user.attribute.country": "country",
                    "introspection.token.claim": "true",
                    "user.attribute.postal_code": "postal_code",
                    "userinfo.token.claim": "true",
                    "user.attribute.street": "street",
                    "id.token.claim": "true",
                    "user.attribute.region": "region",
                    "access.token.claim": "true",
                    "user.attribute.locality": "locality",
                },
            }
        ],
    },
    {
        "id": "7f477610-425d-4836-b615-1a3b37d00773",
        "name": "roles",
        "description": "OpenID Connect scope for add user roles to the access token",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "false",
            "consent.screen.text": "${rolesScopeConsentText}",
            "display.on.consent.screen": "true",
        },
        "protocolMappers": [
            {
                "id": "d4aebd79-06b8-4453-ab94-b8bebbc72f49",
                "name": "realm roles",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-realm-role-mapper",
                "consentRequired": False,
                "config": {
                    "user.attribute": "foo",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "realm_access.roles",
                    "jsonType.label": "String",
                    "multivalued": "true",
                },
            },
            {
                "id": "d67b3688-96a3-4ee5-9f42-c55c1021a32b",
                "name": "client roles",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-client-role-mapper",
                "consentRequired": False,
                "config": {
                    "user.attribute": "foo",
                    "introspection.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "resource_access.${client_id}.roles",
                    "jsonType.label": "String",
                    "multivalued": "true",
                },
            },
            {
                "id": "cc028e69-725c-43d7-b9eb-6cefe390f0ec",
                "name": "audience resolve",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-audience-resolve-mapper",
                "consentRequired": False,
                "config": {
                    "access.token.claim": "true",
                    "introspection.token.claim": "true",
                },
            },
        ],
    },
    {
        "id": "e824414b-facb-4277-90c1-a187b589ed7b",
        "name": "microprofile-jwt",
        "description": "Microprofile - JWT built-in scope",
        "protocol": "openid-connect",
        "attributes": {
            "include.in.token.scope": "true",
            "display.on.consent.screen": "false",
        },
        "protocolMappers": [
            {
                "id": "67c88902-930e-44f9-b0e8-1038124820ab",
                "name": "upn",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-attribute-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "userinfo.token.claim": "true",
                    "user.attribute": "username",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "upn",
                    "jsonType.label": "String",
                },
            },
            {
                "id": "b55f8d04-aa2f-4017-b6d5-50562ff3726b",
                "name": "groups",
                "protocol": "openid-connect",
                "protocolMapper": "oidc-usermodel-realm-role-mapper",
                "consentRequired": False,
                "config": {
                    "introspection.token.claim": "true",
                    "multivalued": "true",
                    "user.attribute": "foo",
                    "id.token.claim": "true",
                    "access.token.claim": "true",
                    "claim.name": "groups",
                    "jsonType.label": "String",
                },
            },
        ],
    },
]


KEYCLOAK_SCOPES_MAPPING = {
    "e273eb7c-6ed1-427a-b292-d70d0fe6d6a1": {
        "realmMappings": [
            {
                "id": "174ab56d-57be-413e-a8f7-d370091be3df",
                "name": "springfield-voter",
                "description": "Springfield voter",
                "composite": False,
                "clientRole": False,
                "containerId": "a18ee71e-2991-4987-8a9b-2ee3a338455b",
            }
        ]
    },
    "17f2be1d-e95a-4f55-b56e-c60576f5cbf6": {
        "clientMappings": {
            "springfield-powerplant": {
                "id": "92b51cf6-e996-4263-b375-67bcf9bab926",
                "client": "springfield-powerplant",
                "mappings": [
                    {
                        "id": "b31f09b1-18f1-42b0-bbd4-4da5134da573",
                        "name": "powerplant-employee",
                        "description": "",
                        "composite": False,
                        "clientRole": True,
                        "containerId": "92b51cf6-e996-4263-b375-67bcf9bab926",
                    }
                ],
            }
        }
    },
    "b6853ac9-a428-4cdc-a61e-0147c8f37fc5": {
        "realmMappings": [
            {
                "id": "858363de-710b-40f8-9086-d8b2f303dfc4",
                "name": "offline_access",
                "description": "${role_offline-access}",
                "composite": False,
                "clientRole": False,
                "containerId": "a18ee71e-2991-4987-8a9b-2ee3a338455b",
            }
        ]
    },
}
